package com.czx.greendaodemo;

import android.app.Application;

import com.czx.greendaodemo.DaoMaster.DevOpenHelper;

import org.greenrobot.greendao.database.Database;

public class MyApplication extends Application {

    private DaoSession daoSession;

    @Override
    public void onCreate() {
        super.onCreate();
        DevOpenHelper devOpenHelper = new DevOpenHelper(this, "roam-db");
        Database db = devOpenHelper.getWritableDb();
        daoSession = new DaoMaster(db).newSession();
    }

    public DaoSession getDaoSession() {
        return daoSession;
    }
}
